import React, { Component } from 'react'

import {connect} from 'react-redux'

class Counter extends Component {
    
  render() {
    // console.log(this.props);
    return (
      <div>{this.props.count}</div>
    )
  }
}

const mapState = state => {
    // console.log(state);    // 改成redux-immutable 包裹 redux 数据，这里的state变成 immutable 格式
    return {
        // count: state.counter.count
        count: state.getIn(['counter', 'count'])     // immutable 方式取值
    }
}

export default connect(mapState)(Counter)
